//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MarketplaceCatalog service.
///
/// Catalog API actions allow you to manage your entities through list, describe, and update capabilities. An entity can be a product or an offer on AWS Marketplace.  You can automate your entity update process by integrating the AWS Marketplace Catalog API with your AWS Marketplace product build or deployment pipelines. You can also create your own applications on top of the Catalog API to manage your products on AWS Marketplace.
public struct MarketplaceCatalog: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MarketplaceCatalog client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MarketplaceCatalog",
            serviceIdentifier: "catalog.marketplace",
            signingName: "aws-marketplace",
            serviceProtocol: .restjson,
            apiVersion: "2018-09-17",
            endpoint: endpoint,
            errorType: MarketplaceCatalogErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Returns metadata and content for multiple entities. This is the Batch version of the DescribeEntity API and uses the same IAM permission action as DescribeEntity API.
    @Sendable
    @inlinable
    public func batchDescribeEntities(_ input: BatchDescribeEntitiesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchDescribeEntitiesResponse {
        try await self.client.execute(
            operation: "BatchDescribeEntities", 
            path: "/BatchDescribeEntities", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns metadata and content for multiple entities. This is the Batch version of the DescribeEntity API and uses the same IAM permission action as DescribeEntity API.
    ///
    /// Parameters:
    ///   - entityRequestList: List of entity IDs and the catalogs the entities are present in.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchDescribeEntities(
        entityRequestList: [EntityRequest],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchDescribeEntitiesResponse {
        let input = BatchDescribeEntitiesRequest(
            entityRequestList: entityRequestList
        )
        return try await self.batchDescribeEntities(input, logger: logger)
    }

    /// Used to cancel an open change request. Must be sent before the status of the request changes to APPLYING, the final stage of completing your change request. You can describe a change during the 60-day request history retention period for API calls.
    @Sendable
    @inlinable
    public func cancelChangeSet(_ input: CancelChangeSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelChangeSetResponse {
        try await self.client.execute(
            operation: "CancelChangeSet", 
            path: "/CancelChangeSet", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Used to cancel an open change request. Must be sent before the status of the request changes to APPLYING, the final stage of completing your change request. You can describe a change during the 60-day request history retention period for API calls.
    ///
    /// Parameters:
    ///   - catalog: Required. The catalog related to the request. Fixed value: AWSMarketplace.
    ///   - changeSetId: Required. The unique identifier of the StartChangeSet request that you want to cancel.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelChangeSet(
        catalog: String,
        changeSetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelChangeSetResponse {
        let input = CancelChangeSetRequest(
            catalog: catalog, 
            changeSetId: changeSetId
        )
        return try await self.cancelChangeSet(input, logger: logger)
    }

    /// Deletes a resource-based policy on an entity that is identified by its resource ARN.
    @Sendable
    @inlinable
    public func deleteResourcePolicy(_ input: DeleteResourcePolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteResourcePolicyResponse {
        try await self.client.execute(
            operation: "DeleteResourcePolicy", 
            path: "/DeleteResourcePolicy", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a resource-based policy on an entity that is identified by its resource ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the entity resource that is associated with the resource policy.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteResourcePolicy(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteResourcePolicyResponse {
        let input = DeleteResourcePolicyRequest(
            resourceArn: resourceArn
        )
        return try await self.deleteResourcePolicy(input, logger: logger)
    }

    /// Provides information about a given change set.
    @Sendable
    @inlinable
    public func describeChangeSet(_ input: DescribeChangeSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeChangeSetResponse {
        try await self.client.execute(
            operation: "DescribeChangeSet", 
            path: "/DescribeChangeSet", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides information about a given change set.
    ///
    /// Parameters:
    ///   - catalog: Required. The catalog related to the request. Fixed value: AWSMarketplace
    ///   - changeSetId: Required. The unique identifier for the StartChangeSet request that you want to describe the details for.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeChangeSet(
        catalog: String,
        changeSetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeChangeSetResponse {
        let input = DescribeChangeSetRequest(
            catalog: catalog, 
            changeSetId: changeSetId
        )
        return try await self.describeChangeSet(input, logger: logger)
    }

    /// Returns the metadata and content of the entity.
    @Sendable
    @inlinable
    public func describeEntity(_ input: DescribeEntityRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeEntityResponse {
        try await self.client.execute(
            operation: "DescribeEntity", 
            path: "/DescribeEntity", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the metadata and content of the entity.
    ///
    /// Parameters:
    ///   - catalog: Required. The catalog related to the request. Fixed value: AWSMarketplace
    ///   - entityId: Required. The unique ID of the entity to describe.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeEntity(
        catalog: String,
        entityId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeEntityResponse {
        let input = DescribeEntityRequest(
            catalog: catalog, 
            entityId: entityId
        )
        return try await self.describeEntity(input, logger: logger)
    }

    /// Gets a resource-based policy of an entity that is identified by its resource ARN.
    @Sendable
    @inlinable
    public func getResourcePolicy(_ input: GetResourcePolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetResourcePolicyResponse {
        try await self.client.execute(
            operation: "GetResourcePolicy", 
            path: "/GetResourcePolicy", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets a resource-based policy of an entity that is identified by its resource ARN.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the entity resource that is associated with the resource policy.
    ///   - logger: Logger use during operation
    @inlinable
    public func getResourcePolicy(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetResourcePolicyResponse {
        let input = GetResourcePolicyRequest(
            resourceArn: resourceArn
        )
        return try await self.getResourcePolicy(input, logger: logger)
    }

    /// Returns the list of change sets owned by the account being used to make the call. You can filter this list by providing any combination of entityId, ChangeSetName, and status. If you provide more than one filter, the API operation applies a logical AND between the filters. You can describe a change during the 60-day request history retention period for API calls.
    @Sendable
    @inlinable
    public func listChangeSets(_ input: ListChangeSetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChangeSetsResponse {
        try await self.client.execute(
            operation: "ListChangeSets", 
            path: "/ListChangeSets", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the list of change sets owned by the account being used to make the call. You can filter this list by providing any combination of entityId, ChangeSetName, and status. If you provide more than one filter, the API operation applies a logical AND between the filters. You can describe a change during the 60-day request history retention period for API calls.
    ///
    /// Parameters:
    ///   - catalog: The catalog related to the request. Fixed value: AWSMarketplace
    ///   - filterList: An array of filter objects.
    ///   - maxResults: The maximum number of results returned by a single call. This value must be provided in the next call to retrieve the next set of results. By default, this value is 20.
    ///   - nextToken: The token value retrieved from a previous call to access the next page of results.
    ///   - sort: An object that contains two attributes, SortBy and SortOrder.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChangeSets(
        catalog: String,
        filterList: [Filter]? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        sort: Sort? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChangeSetsResponse {
        let input = ListChangeSetsRequest(
            catalog: catalog, 
            filterList: filterList, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            sort: sort
        )
        return try await self.listChangeSets(input, logger: logger)
    }

    /// Provides the list of entities of a given type.
    @Sendable
    @inlinable
    public func listEntities(_ input: ListEntitiesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEntitiesResponse {
        try await self.client.execute(
            operation: "ListEntities", 
            path: "/ListEntities", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides the list of entities of a given type.
    ///
    /// Parameters:
    ///   - catalog: The catalog related to the request. Fixed value: AWSMarketplace
    ///   - entityType: The type of entities to retrieve. Valid values are: AmiProduct, ContainerProduct, DataProduct, SaaSProduct, ProcurementPolicy, Experience, Audience, BrandingSettings, Offer, Seller, ResaleAuthorization.
    ///   - entityTypeFilters: A Union object containing filter shapes for all EntityTypes. Each EntityTypeFilter shape will have filters applicable for that EntityType that can be used to search or filter entities.
    ///   - entityTypeSort: A Union object containing Sort shapes for all EntityTypes. Each EntityTypeSort shape will have SortBy and SortOrder applicable for fields on that EntityType. This can be used to sort the results of the filter query.
    ///   - filterList: An array of filter objects. Each filter object contains two attributes, filterName and filterValues.
    ///   - maxResults: Specifies the upper limit of the elements on a single page. If a value isn't provided, the default value is 20.
    ///   - nextToken: The value of the next token, if it exists. Null if there are no more results.
    ///   - ownershipType: Filters the returned set of entities based on their owner. The default is SELF. To list entities shared with you through AWS Resource Access Manager (AWS RAM), set to SHARED. Entities shared through the AWS Marketplace Catalog API PutResourcePolicy operation can't be discovered through the SHARED parameter.
    ///   - sort: An object that contains two attributes, SortBy and SortOrder.
    ///   - logger: Logger use during operation
    @inlinable
    public func listEntities(
        catalog: String,
        entityType: String,
        entityTypeFilters: EntityTypeFilters? = nil,
        entityTypeSort: EntityTypeSort? = nil,
        filterList: [Filter]? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        ownershipType: OwnershipType? = nil,
        sort: Sort? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEntitiesResponse {
        let input = ListEntitiesRequest(
            catalog: catalog, 
            entityType: entityType, 
            entityTypeFilters: entityTypeFilters, 
            entityTypeSort: entityTypeSort, 
            filterList: filterList, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            ownershipType: ownershipType, 
            sort: sort
        )
        return try await self.listEntities(input, logger: logger)
    }

    /// Lists all tags that have been added to a resource (either an entity or change set).
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/ListTagsForResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all tags that have been added to a resource (either an entity or change set).
    ///
    /// Parameters:
    ///   - resourceArn: Required. The Amazon Resource Name (ARN) associated with the resource you want to list tags on.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Attaches a resource-based policy to an entity. Examples of an entity include: AmiProduct and ContainerProduct.
    @Sendable
    @inlinable
    public func putResourcePolicy(_ input: PutResourcePolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutResourcePolicyResponse {
        try await self.client.execute(
            operation: "PutResourcePolicy", 
            path: "/PutResourcePolicy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Attaches a resource-based policy to an entity. Examples of an entity include: AmiProduct and ContainerProduct.
    ///
    /// Parameters:
    ///   - policy: The policy document to set; formatted in JSON.
    ///   - resourceArn: The Amazon Resource Name (ARN) of the entity resource you want to associate with a resource policy.
    ///   - logger: Logger use during operation
    @inlinable
    public func putResourcePolicy(
        policy: String,
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutResourcePolicyResponse {
        let input = PutResourcePolicyRequest(
            policy: policy, 
            resourceArn: resourceArn
        )
        return try await self.putResourcePolicy(input, logger: logger)
    }

    /// Allows you to request changes for your entities. Within a single ChangeSet, you can't start the same change type against the same entity multiple times. Additionally, when a ChangeSet is running, all the entities targeted by the different changes are locked until the change set has completed (either succeeded, cancelled, or failed). If you try to start a change set containing a change against an entity that is already locked, you will receive a ResourceInUseException error. For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same change type (AddRevisions) against the same entity (entity-id@1). For more information about working with change sets, see  Working with change sets. For information about change types for single-AMI products, see Working with single-AMI products. Also, for more information about change types available for container-based products, see Working with container products. To download "DetailsDocument" shapes, see Python  and Java shapes on GitHub.
    @Sendable
    @inlinable
    public func startChangeSet(_ input: StartChangeSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartChangeSetResponse {
        try await self.client.execute(
            operation: "StartChangeSet", 
            path: "/StartChangeSet", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Allows you to request changes for your entities. Within a single ChangeSet, you can't start the same change type against the same entity multiple times. Additionally, when a ChangeSet is running, all the entities targeted by the different changes are locked until the change set has completed (either succeeded, cancelled, or failed). If you try to start a change set containing a change against an entity that is already locked, you will receive a ResourceInUseException error. For example, you can't start the ChangeSet described in the example later in this topic because it contains two changes to run the same change type (AddRevisions) against the same entity (entity-id@1). For more information about working with change sets, see  Working with change sets. For information about change types for single-AMI products, see Working with single-AMI products. Also, for more information about change types available for container-based products, see Working with container products. To download "DetailsDocument" shapes, see Python  and Java shapes on GitHub.
    ///
    /// Parameters:
    ///   - catalog: The catalog related to the request. Fixed value: AWSMarketplace
    ///   - changeSet: Array of change object.
    ///   - changeSetName: Optional case sensitive string of up to 100 ASCII characters. The change set name can be used to filter the list of change sets.
    ///   - changeSetTags: A list of objects specifying each key name and value for the ChangeSetTags property.
    ///   - clientRequestToken: A unique token to identify the request to ensure idempotency.
    ///   - intent: The intent related to the request. The default is APPLY. To test your request before applying changes to your entities, use VALIDATE. This feature is currently available for adding versions to single-AMI products. For more information, see Add a new version.
    ///   - logger: Logger use during operation
    @inlinable
    public func startChangeSet(
        catalog: String,
        changeSet: [Change],
        changeSetName: String? = nil,
        changeSetTags: [Tag]? = nil,
        clientRequestToken: String? = StartChangeSetRequest.idempotencyToken(),
        intent: Intent? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartChangeSetResponse {
        let input = StartChangeSetRequest(
            catalog: catalog, 
            changeSet: changeSet, 
            changeSetName: changeSetName, 
            changeSetTags: changeSetTags, 
            clientRequestToken: clientRequestToken, 
            intent: intent
        )
        return try await self.startChangeSet(input, logger: logger)
    }

    /// Tags a resource (either an entity or change set).
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/TagResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tags a resource (either an entity or change set).
    ///
    /// Parameters:
    ///   - resourceArn: Required. The Amazon Resource Name (ARN) associated with the resource you want to tag.
    ///   - tags: Required. A list of objects specifying each key name and value. Number of objects allowed: 1-50.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes a tag or list of tags from a resource (either an entity or change set).
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/UntagResource", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a tag or list of tags from a resource (either an entity or change set).
    ///
    /// Parameters:
    ///   - resourceArn: Required. The Amazon Resource Name (ARN) associated with the resource you want to remove the tag from.
    ///   - tagKeys: Required. A list of key names of tags to be removed. Number of strings allowed: 0-256.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }
}

extension MarketplaceCatalog {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MarketplaceCatalog, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MarketplaceCatalog {
    /// Return PaginatorSequence for operation ``listChangeSets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChangeSetsPaginator(
        _ input: ListChangeSetsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChangeSetsRequest, ListChangeSetsResponse> {
        return .init(
            input: input,
            command: self.listChangeSets,
            inputKey: \ListChangeSetsRequest.nextToken,
            outputKey: \ListChangeSetsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChangeSets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - catalog: The catalog related to the request. Fixed value: AWSMarketplace
    ///   - filterList: An array of filter objects.
    ///   - maxResults: The maximum number of results returned by a single call. This value must be provided in the next call to retrieve the next set of results. By default, this value is 20.
    ///   - sort: An object that contains two attributes, SortBy and SortOrder.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChangeSetsPaginator(
        catalog: String,
        filterList: [Filter]? = nil,
        maxResults: Int? = nil,
        sort: Sort? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChangeSetsRequest, ListChangeSetsResponse> {
        let input = ListChangeSetsRequest(
            catalog: catalog, 
            filterList: filterList, 
            maxResults: maxResults, 
            sort: sort
        )
        return self.listChangeSetsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listEntities(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listEntitiesPaginator(
        _ input: ListEntitiesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListEntitiesRequest, ListEntitiesResponse> {
        return .init(
            input: input,
            command: self.listEntities,
            inputKey: \ListEntitiesRequest.nextToken,
            outputKey: \ListEntitiesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listEntities(_:logger:)``.
    ///
    /// - Parameters:
    ///   - catalog: The catalog related to the request. Fixed value: AWSMarketplace
    ///   - entityType: The type of entities to retrieve. Valid values are: AmiProduct, ContainerProduct, DataProduct, SaaSProduct, ProcurementPolicy, Experience, Audience, BrandingSettings, Offer, Seller, ResaleAuthorization.
    ///   - entityTypeFilters: A Union object containing filter shapes for all EntityTypes. Each EntityTypeFilter shape will have filters applicable for that EntityType that can be used to search or filter entities.
    ///   - entityTypeSort: A Union object containing Sort shapes for all EntityTypes. Each EntityTypeSort shape will have SortBy and SortOrder applicable for fields on that EntityType. This can be used to sort the results of the filter query.
    ///   - filterList: An array of filter objects. Each filter object contains two attributes, filterName and filterValues.
    ///   - maxResults: Specifies the upper limit of the elements on a single page. If a value isn't provided, the default value is 20.
    ///   - ownershipType: Filters the returned set of entities based on their owner. The default is SELF. To list entities shared with you through AWS Resource Access Manager (AWS RAM), set to SHARED. Entities shared through the AWS Marketplace Catalog API PutResourcePolicy operation can't be discovered through the SHARED parameter.
    ///   - sort: An object that contains two attributes, SortBy and SortOrder.
    ///   - logger: Logger used for logging
    @inlinable
    public func listEntitiesPaginator(
        catalog: String,
        entityType: String,
        entityTypeFilters: EntityTypeFilters? = nil,
        entityTypeSort: EntityTypeSort? = nil,
        filterList: [Filter]? = nil,
        maxResults: Int? = nil,
        ownershipType: OwnershipType? = nil,
        sort: Sort? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListEntitiesRequest, ListEntitiesResponse> {
        let input = ListEntitiesRequest(
            catalog: catalog, 
            entityType: entityType, 
            entityTypeFilters: entityTypeFilters, 
            entityTypeSort: entityTypeSort, 
            filterList: filterList, 
            maxResults: maxResults, 
            ownershipType: ownershipType, 
            sort: sort
        )
        return self.listEntitiesPaginator(input, logger: logger)
    }
}

extension MarketplaceCatalog.ListChangeSetsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MarketplaceCatalog.ListChangeSetsRequest {
        return .init(
            catalog: self.catalog,
            filterList: self.filterList,
            maxResults: self.maxResults,
            nextToken: token,
            sort: self.sort
        )
    }
}

extension MarketplaceCatalog.ListEntitiesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MarketplaceCatalog.ListEntitiesRequest {
        return .init(
            catalog: self.catalog,
            entityType: self.entityType,
            entityTypeFilters: self.entityTypeFilters,
            entityTypeSort: self.entityTypeSort,
            filterList: self.filterList,
            maxResults: self.maxResults,
            nextToken: token,
            ownershipType: self.ownershipType,
            sort: self.sort
        )
    }
}
